home *** CD-ROM | disk | FTP | other *** search
- property spritenum, memberNum, ancestor, windowBottom, basePos
-
- on new me, parameterList
- set spritenum to getProp(parameterList, #spritenum)
- set memberNum to getaProp(parameterList, #memberNum)
- if stringp(memberNum) then
- set memberNum to the number of member memberNum
- end if
- set windowBottom to getaProp(parameterList, #windowBottom)
- set basePos to getaProp(parameterList, #basePos)
- if not objectp(basePos) then
- set basePos to the loc of sprite spritenum
- end if
- set textString to getaProp(parameterList, #initText)
- if stringp(textString) and (memberNum > 0) then
- set the text of member memberNum to textString
- end if
- return me
- end
-
- on init me, newText
- if memberNum <= 0 then
- set memberNum to the memberNum of sprite spritenum
- end if
- set the text of member memberNum to newText
- if the puppet of sprite spritenum = 1 then
- set the loc of sprite spritenum to basePos
- set the memberNum of sprite spritenum to memberNum
- else
- set basePos to the loc of sprite spritenum
- end if
- set the visible of sprite spritenum to 1
- end
-
- on ScrollPercent me, percent
- if the puppet of sprite spritenum = 0 then
- set basePos to the loc of sprite spritenum
- if memberNum <= 0 then
- set memberNum to the memberNum of sprite spritenum
- end if
- puppetSprite(spritenum, 1)
- end if
- set windowHeight to windowBottom - the locV of basePos
- set range to the height of member memberNum - windowHeight
- if range < 0 then
- set range to 0
- end if
- set diff to range * percent / 100
- set the locV of sprite spritenum to the locV of basePos - diff
- updateStage()
- end
-
- on ScrollLines me, delta
- if the puppet of sprite spritenum = 0 then
- set basePos to the loc of sprite spritenum
- if memberNum <= 0 then
- set memberNum to the memberNum of sprite spritenum
- end if
- puppetSprite(spritenum, 1)
- end if
- set lineShift to lineHeight(member memberNum, 1)
- set pixelShift to lineShift * delta
- set windowHeight to windowBottom - the locV of basePos
- set range to the height of member memberNum - windowHeight
- if range < 0 then
- set range to 0
- end if
- set minYPos to the locV of basePos - range
- set yPos to the locV of sprite spritenum
- set yPos to yPos + pixelShift
- if yPos > the locV of basePos then
- set yPos to the locV of basePos
- else
- if yPos < minYPos then
- set yPos to minYPos
- end if
- end if
- puppetSprite(spritenum, 1)
- set the locV of sprite spritenum to yPos
- updateStage()
- end
-
- on clear me
- if memberNum <= 0 then
- set memberNum to the memberNum of sprite spritenum
- end if
- set the text of member memberNum to " "
- set the visible of sprite spritenum to 0
- end
-
- on dispose me
- put "dispose Text Display Class" && me
- puppetSprite(spritenum, 0)
- set the visible of sprite spritenum to 1
- set basePos to 0
- if objectp(ancestor) then
- dispose(ancestor)
- end if
- set ancestor to 0
- end
-